package com.handwriting.backend.utils;

import java.io.File;
import java.util.Calendar;

public class Utils {
    public static String genModelName() {
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        int min = calendar.get(Calendar.MINUTE);
        int sec = calendar.get(Calendar.SECOND);
        return year + "-" + month + "-" + day + "_" + hour + "." + min + "." + sec;
    }

    public static String pathJoin(String path1, String... paths) {
        StringBuilder builder = new StringBuilder();
        builder.append(path1);
        for (String path : paths) {
            System.out.println(path);
            System.out.println(File.pathSeparatorChar);
            builder.append(File.pathSeparator);
            builder.append(path);
        }
        return builder.toString();
    }
}
